#sing SetLocal EnableDelayedExpansion
#newl set varLanguage=Croatian&set varEncodingIn=windows-1250|#newl set varLanguage=Serbian&set varEncodingIn=windows-1251|#newl set varLanguage=English&set varEncodingIn=windows-1250|#newl set varLanguage=Russian&set varEncodingIn=windows-1251
#newl set extractedImage=#path#name-imageex-|
#newl IF /I #exte==.pdf (
#newl "#ppthapps\+\gs\bin\gswin32c.exe" |--convert pdf to tiff--
-r2400 |-r300 |--resolution. Higher resolution is used with downscalling.--
#remark PDF pages to process. Default setting is to process all pages|-dFirstPage=1 -dLastPage=3 |--Choose first and last page.--
-dTextAlphaBits=4 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dDownScaleFactor=8 -sDEVICE=tiffscaled8 -sCompression=pack -o "%extractedImage%%%03d.tif"   "#item" |--more settings--
#newl ) ELSE (
#newl "#ppthapps\convert\convert.exe"  |-extract images app-
"#item" |--input-
"%extractedImage%%%03d.tif" |--output-
#newl )
#newl echo( >"#path-1st.txt"|
#newl FOR %%a in ("%extractedImage%*.*") do (
#newl "#ppthapps\cuneiform-clvb\cuneiform-clvb.exe" |-program file-
-LoadImage="%%a" |-input-
-FileFormat=TxtAnsi    -RecognizeToFileName="%%a.txt" |
#remark enable spellcheck, default on|-EnableSpeller=false |
-Language=%varLanguage% |-Language=Croatian |-Language=Serbian |-Language=English |-Language=Russian |
-RecognizePictures=false |-RecognizePictures=true |--remark recognize pictures, on by default--
-DetectBold=false |-DetectBold=true |-detect bold, default on(true)-
-DetectItalic=false |-DetectItalic=true |-detect italic, default on(true)-
-DetectSize=false |-DetectSize=true |-detect font size, default on(true)-
#newl copy /b "#path-1st.txt" + "%%a.txt" "#path-all.txt" |
#newl copy "#path-all.txt" "#path-1st.txt" |
#newl del "%%a.txt" |-cleaning-
#newl del "%%a" |-cleaning-
#newl )
#newl del "#path-all.txt" |-cleaning, it gets overwritten anyway always, so just delete it after the last file is done-
#newl "#ppthapps\txt2rtf-clvb\txt2rtf-clvb.exe" -stFileIn="#path-1st.txt" -stFileOut="#path#name-cu.rtf" |
-stEncodingIn=%varEncodingIn% |-stEncodingIn="windows-1250" |-stEncodingIn="windows-1251" |
-stFontFamily="Times New Roman" -siFontSize=12 |-stFontFamily="Arial" -siFontSize=12 |
#newl del "#path-1st.txt" |-cleaning, final-

<comment>
Convert PDF or multipage tiff, to text using OCR (Optical character recognition).
Uses cuneiform ocr. Does not preserve formatting and tables.
Better results if images are extracted to multipage tiff using pdf-exchange, first.
If using with Cyrillic, change language to Serbian.
Program accepts pdf and images, including multipage tiff.
For converting multiple images, look into 'other' folder, or convert images to multipage tiff first.

MAKE SURE YOU INSTALL PUMA.NET: Go to "gulmencoder3\apps\+\Puma.NET\COM Server"
and, as administrator, run  file "1Register.bat".

Libre Office has some problems writing tables in rtf? Use Wps2014 office if editing rtf.

if pdf, convert to multipage tiff.
else "convert to multipage tiff"/"convert [image] to tiff(no compression?)"